package com.heima.wemedia.newsAuthor;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.wemedia.service.WmNewsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping
public class NewsAuthor {

    private final WmNewsService wmNewsService;


    /**
     * 文章人工审核分页查询
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/list_vo")
    ResponseResult newsAuthList(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.newsAuthList(newsAuthDto);
    }

    /**
     * 查询文章详情
     * @param id
     * @return
     */
    @GetMapping("/one_vo/{id}")
    ResponseResult queryNewsOne(@PathVariable Integer id ){
        return wmNewsService.queryNewsOne(id);
    }


    /**
     * 文章审核失败
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/auth_fail")
    ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.authFail(newsAuthDto);
    }

    /**
     * 文章审核成功
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/auth_pass")
    ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto){
        return wmNewsService.authPass(newsAuthDto);
    }



}
